//
//  ViewController.m
//  10502
//
//  Created by 小白 on 16/2/19.
//  Copyright © 2016年 小白. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)btnpress:(id)sender {
    //获取textview文字
    NSString *vlaue1 = [NSString stringWithFormat:@"%@",self.tview1.text];
    NSString *valuetname = [NSString stringWithFormat:@"%@",self.nameTX.text];
    NSString *Valuetage = [NSString stringWithFormat:@"%@",self.ageTX.text];
    NSString *Valuetclass = [NSString stringWithFormat:@"%@",self.classTX.text];
    //将textview模板文字替换并生成生成模板
    NSString *value2 = [vlaue1 stringByReplacingOccurrencesOfString:@"<name>" withString:valuetname];
    value2 = [value2 stringByReplacingOccurrencesOfString:@"<age>" withString:Valuetage];
    value2 = [value2 stringByReplacingOccurrencesOfString:@"<class>" withString:Valuetclass];
    //赋值
    self.tview2.text = value2;
    
    
}


- (IBAction)UIback:(id)sender {
    [self.view endEditing:YES];
}
@end
